Be compatible with Python 3.14
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
committerGraham Inggs <ginggs@debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
Accept new (Python 3.14) wording of error messages
Ignore some ResourceWarnings

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/1121955
Forwarded: no

Gbp-Pq: Name python3p14_compat.patch

pandas/tests/computation/test_eval.py
pandas/tests/io/test_html.py
pandas/tests/io/xml/test_xml.py

index e9f7016b2e703297e62f5fee43aae5268ec331a3..cbcef840c4fdb6faaa8b163da17fc9734a0e5a8a 100644 (file)
@@ -177,7 +177,7 @@ class TestEval:
                 r"only list-like( or dict-like)? objects are allowed to be "
                 r"passed to (DataFrame\.)?isin\(\), you passed a "
                 r"(`|')bool(`|')",
-                "argument of type 'bool' is not iterable",
+                "argument of type 'bool' is not (a container or )?iterable",
             ]
         )
         if cmp_op in ("in", "not in") and not is_list_like(rhs):
@@ -222,7 +222,7 @@ class TestEval:
                 r"only list-like( or dict-like)? objects are allowed to be "
                 r"passed to (DataFrame\.)?isin\(\), you passed a "
                 r"(`|')float(`|')",
-                "argument of type 'float' is not iterable",
+                "argument of type 'float' is not (a container or )?iterable",
             ]
         )
         if is_scalar(rhs) and op in skip_these:
@@ -1092,7 +1092,7 @@ class TestOperations:
             ex3 = f"1 {op} (x + 1)"
 
             if op in ("in", "not in"):
-                msg = "argument of type 'int' is not iterable"
+                msg = "argument of type 'int' is not (a container or )?iterable"
                 with pytest.raises(TypeError, match=msg):
                     pd.eval(ex, engine=engine, parser=parser)
             else:
index d5e8f1065eec7ae38f12a4857d1f6fd249607524..901ded32a4a1a19f22aca740a59c2a022e068506 100644 (file)
@@ -389,6 +389,7 @@ class TestReadHtml:
     @pytest.mark.slow
     @pytest.mark.network
     @pytest.mark.single_cpu
+    @pytest.mark.xfail(reason="404 object not cleaned up in python 3.14",raises=pytest.PytestUnraisableExceptionWarning,strict=False)
     def test_invalid_url(self, httpserver, flavor_read_html):
         httpserver.serve_content("Name or service not known", code=404)
         with pytest.raises((URLError, ValueError), match="HTTP Error 404: NOT FOUND"):
index 58bec3964c3eee740b370bcecd99cfd5869d1b27..f9785850695a92b62d2aae408d492ce22511b65a 100644 (file)
@@ -520,6 +520,7 @@ def test_url(httpserver, xml_file):
 
 @pytest.mark.network
 @pytest.mark.single_cpu
+@pytest.mark.xfail(reason="404 object not cleaned up in python 3.14",raises=pytest.PytestUnraisableExceptionWarning,strict=False)
 def test_wrong_url(parser, httpserver):
     httpserver.serve_content("NOT FOUND", code=404)
     with pytest.raises(HTTPError, match=("HTTP Error 404: NOT FOUND")):